//
// Created by hyh on 4/29/20.
//

#ifndef VIDEOPLAYER_AUDIORECORD_H
#define VIDEOPLAYER_AUDIORECORD_H


#include <Log.h>
static int audio_count = 0;
class AudioRecord {
private:
    AVCodecContext *audioCodecCtx = NULL;
    AVCodec *audioCodec;
    AVFrame *audioFrame;
    AVPacket *audioPkt;
    AVFormatContext *audioFormatCtx = NULL;
    AVStream *audioStream = NULL;
    FILE *f = NULL;
    SwrContext *asc = NULL;
    int apts =0;
public:
    void open(const char *filePath);
    void encode(uint8_t *data,int len);
    void stop();
};


#endif //VIDEOPLAYER_AUDIORECORD_H
